	{set:$seo_data=array(); $site_config=new Config('site_config');$site_config=$site_config->getInfo();}
	{set:$seo_data['title']=isset($site_config['name'])?$site_config['name']:""}
	{if:isset($site_config['index_seo_title']) && $site_config['index_seo_title']!="" }
		{set:$seo_data['title'].=$site_config['index_seo_title'];}
	{/if}
	{if:isset($site_config['index_seo_keywords']) && $site_config['index_seo_keywords']!="" }
		{set:$seo_data['keywords']=$site_config['index_seo_keywords'];}
	{/if}
	{if:isset($site_config['index_seo_description']) && $site_config['index_seo_description']!="" }
		{set:$seo_data['description']=$site_config['index_seo_description'];}
	{/if}
	{set:seo::set($seo_data);}

	<script type='text/javascript'>
		//dom载入完毕执行
		jQuery(function(){
			//index 分类展示
			$('#index_category tr').hover(
				function(){
					$(this).addClass('current');
				},
				function(){
					$(this).removeClass('current');
				}
			);

			//email订阅 事件绑定
			var tmpObj = $('input:text[name="orderinfo"]');
			var defaultText = tmpObj.val();
			tmpObj.bind({
				focus:function(){checkInput($(this),defaultText);},
				blur :function(){checkInput($(this),defaultText);}
			});
		});

		//显示抢购倒计时
		var cd_timer=new countdown();

		//电子邮件订阅
		function orderinfo()
		{
			var email = $('[name="orderinfo"]').val();
			if(validate(email,'email') == false)
			{
				alert('请填写正确的email地址');
			}
			else
			{
				$.getJSON('{url:/site/email_registry}',{email:email},function(content){
					if(content.isError == false)
					{
						alert('订阅成功');
						$('[name="orderinfo"]').val('');
					}
					else
						alert(content.message);
				});
			}
		}
	</script>

	<div class="wrapper clearfix">
		<div class="sidebar f_r">

			<!--cms新闻展示-->
			<div class="box m_10">
				<div class="title"><h2>Shop资讯</h2><a class="more" href="{url:/site/article}">更多...</a></div>
				<div class="cont">
					<ul class="list">
						{query:name=article where=visiblity eq 1 and top eq 1 order=sort ASC,id DESC fields=title,id,style,color limit=5}
						{set:$tmpId=$item['id'];}
						<li><a href="{url:/site/article_detail/id/$tmpId}">{echo:Article::showTitle($item['title'],$item['color'],$item['style'])}</a></li>
						{/query}
					</ul>
				</div>
			</div>
			<!--cms新闻展示-->

			<div class="box">
				<div id="adHere_7"></div>
				<script language="javascript">
				(new adLoader()).load(7,'adHere_7');
				</script>
			</div>
		</div>

		<div class="main f_l">

			{if:count($this->index_slide)}
			{set:$num=count($this->index_slide);$i=0;$width=intval(100/$num);}
			<div id="slide_box" class="slide box" style="width:750px;height:299px;overflow:hidden;position:relative;">
				<div id="slide_img" style="position:relative;">
					{foreach:items=$this->index_slide}
					<a href="{$item['url']}" target="_blank"><img src="{webroot:$item[img]}" width="750" /></a>
					{set:break;}
					{/foreach}
				</div>
				<div class="slide_button" style="width:760px;overflow:hidden;">
					{foreach:items=$this->index_slide}
						{set:$i++;}
						{if:$i==$num}
							{set:$width=100-($num-1)*$width;}
						{/if}
					<a style="width:{$width}%" href='{$item['url']}' pic='{webroot:$item[img]}'>{$item['name']}</a>
					{/foreach}
				</div>

			</div>
			{else:}
			<div class="slide box" style="width:728px;height:299px;overflow:hidden;position:relative;">
			</div>
			{/if}

		</div>
<style type='text/css'>
.slide_button{position:absolute;bottom:0px;left:0px;right:0px;height:30px;overflow:hidden;width:100%;background:#fff;}
.slide_button a{display:block;height:30px;line-height:30px;color:#333;float:left;background:#dddddd;}
.slide_button a.current,#slide_name a:hover{background:#a8a8a8;color:#fff; font-weight:bold}
</style>
<script type='text/javascript'>
function slide(arr)
{
	var _self=this;
	this.is_mouseover=false;
	this.arr=arr;

	this.init=function()
	{
		$(arr+" .slide_button a").mouseover(function(){ _self.show(this); });
		$(arr+" .slide_button a").click(function(){_self.show(this);return false;});
		$(arr+" .slide_button a:first").click();
	}

	this.show=function(slide_a)
	{
		$(arr+ " .slide_button a").removeClass('current');
		$(slide_a).addClass('current');
		var src=$(slide_a).attr('pic');
		var e=$(arr+ " img");
		$(arr + " #slide_img a").attr('href',slide_a.href);
		e.fadeOut('fast',function(){e.attr('src',src);e.fadeIn('fast');});
		$(arr+ " .slide_button a").attr('href',this.href);
	}

	this.autonext=function()
	{
		if(_self.is_mouseover==true)
		{
			return;
		}
		var e=$(_self.arr).find(".slide_button .current").next();
		if(e.length==0)
		{
			e=$(_self.arr).find(".slide_button a:first");
		}
		e.click();

	}
	$(arr).hover(function(){_self.is_mouseover=true;},function(){_self.is_mouseover=false;});
	setInterval(_self.autonext,3000);
}

$(document).ready(function(){
	var slideObj=new slide("#slide_box");
	slideObj.init();
});

</script>
	</div>

	<div class="m_10">
		<div id="adHere_6"></div>
		<script language="javascript">
		(new adLoader()).load(6,'adHere_6');
		</script>
	</div>

	<div class="wrapper clearfix">
		<div class="sidebar f_r">

			<!--团购-->
			<div class="group_on box m_10">
				<div class="title"><h2>团购商品</h2><a class="more" href="{url:/site/groupon}">更多...</a></div>
				<div class="cont">
					<ul class="ranklist">
						{query:name=regiment where=is_close eq 0 and NOW() between start_time and end_time limit=5 fields=id,title,regiment_price,img order=id desc}
						<li class="current">
							{set:$tmpId=$item['id'];}
							<a href="{url:/site/groupon/id/$tmpId}"><img width="60" height="60" alt="{$item['title']}" src="{webroot:$item[img]}"></a>
							<a class="p_name" title="{$item['title']}" href="{url:/site/groupon/id/$tmpId}">{$item['title']}</a><p class="light_gray">团购价：<em>￥{$item['regiment_price']}</em></p>
						</li>
						{/query}
					</ul>
				</div>
			</div>
			<!--团购-->

			<!--限时抢购-->
			<div class="buying box m_10">
				<div class="title"><h2>限时抢购</h2></div>
				<div class="cont clearfix">
					<ul class="prolist">
						{query:name=promotion as p join=left join goods as go on go.id eq p.condition
							fields=p.end_time,go.list_img as list_img,p.name as name,p.award_value as award_value,go.id as goods_id,p.id as p_id,end_time
							where=p.type eq 1 and p.is_close eq 0 and go.is_del eq 0 and NOW() between start_time and end_time AND go.id is not null
							limit=2
						}
						{set:$free_time = ITime::getDiffSec($item['end_time'])}
						<li>
							<p class="countdown">倒计时:<br /><b id='cd_hour_{$item['p_id']}'>{echo:floor($free_time/3600);}</b>时<b id='cd_minute_{$item['p_id']}'>{echo:floor(($free_time%3600)/60);}</b>分<b id='cd_second_{$item['p_id']}'>{echo:$free_time%60;}</b>秒</p>

							<script language="javascript">
								cd_timer.add({$item['p_id']});
							</script>
							{set:$tmpGoodsId=$item['goods_id'];$tmpPId=$item['p_id'];}
							<a href="{url:/site/products/id/$tmpGoodsId/promo/time/regiment_id/$tmpPId}"><img src="{webroot:$item[list_img]}" width="175" height="175" alt="{$item['name']}" title="{$item['name']}" /></a>
							<p class="pro_title"><a href="{url:/site/products/id/$tmpGoodsId/promo/time/regiment_id/$tmpPId}">{$item['name']}</a></p>
							<p class="light_gray">抢购价：<b>￥{$item['award_value']}</b></p>
							<div></div>
						</li>
						{/query}
					</ul>
				</div>
			</div>
			<!--限时抢购-->

			<!--热卖商品-->
			<div class="hot box m_10">
				<div class="title"><h2>热卖商品</h2></div>
				<div class="cont clearfix">
					<ul class="prolist">
						{query:name=commend_goods as co join=left join goods as go on co.goods_id eq go.id
							where=co.commend_id eq 3 and go.is_del eq 0 AND go.id is not null
							fields=go.list_img,go.sell_price,go.name,go.id
							limit=8
							order=sort asc,id desc
						}
						<li>
							{set:$tmpId=$item['id']}
							<a href="{url:/site/products/id/$tmpId}"><img src="{webroot:$item[list_img]}" width="85" height="85" alt="{$item['name']}" /></a>
							<p class="pro_title"><a href="{url:/site/products/id/$tmpId}">{$item['name']}</a></p>
							<p class="brown"><b>￥{$item['sell_price']}</b></p>
						</li>
						{/query}
					</ul>
				</div>
			</div>
			<!--热卖商品-->

			<!--公告通知-->
			<div class="box m_10">
				<div class="title"><h2>公告通知</h2><a class="more" href="{url:/site/notice}">更多...</a></div>
				<div class="cont">
					<ul class="list">
						{query:name=announcement limit=5 order=id desc}
						{set:$tmpId=$item['id'];}
						<li><a href="{url:/site/notice_detail/id/$tmpId}">{$item['title']}</a></li>
						{/query}
					</ul>
				</div>
			</div>
			<!--公告通知-->

			<!--关键词-->
			<div class="box m_10">
				<div class="title"><h2>关键词</h2><a class="more" href="{url:/site/tags}">更多...</a></div>
				<div class="tag cont t_l">
					{set:$classArray = array('bold orange', 'orange');$colorIndex=0;}
					{query:name=keyword where=hot eq 1 limit=8 order=`order` asc}
					{set:$searchWord =urlencode($item['word']);}
					<a href="{url:/site/search_list/word/$searchWord}" class="{echo:$classArray[$colorIndex%count($classArray)]}">{$item['word']}</a>
					{set:$colorIndex++;}
					{/query}
				</div>
			</div>
			<!--关键词-->

			<!--电子订阅-->
			<div class="book box m_10">
				<div class="title"><h2>电子订阅</h2></div>
				<div class="cont">
					<p>我们会将最新的资讯发到您的Email</p>
					<input type="text" class="gray_m light_gray f_l" name='orderinfo' value="输入您的电子邮箱地址" />
					<label class="btn_orange"><input type="button" onclick="orderinfo();" value="订阅" /></label>
				</div>
			</div>
			<!--电子订阅-->

		</div>

		<div class="main f_l">

			<!--商品分类展示-->
			<div class="category box">
				<div class="title2">
					<h2><img src="{skin:images/front/category.gif}" alt="商品分类" width="155" height="36" /></h2>
					<a class="more" href="{url:/site/sitemap}">全部商品分类</a>
				</div>
			</div>
			<table id="index_category" class="sort_table m_10" width="100%">
				<col width="100px" />
				<col />
				{foreach:items=$this->goodsCategory item=$first}
				{if:$first['visibility'] == 1}
				<tr>
					{set:$tmpFirstId=$first['id'];}
					<th><a href="{url:/site/pro_list/cat/$tmpFirstId}">{$first['name']}</a></th>
					<td>
						{if:isset($first['second'])}
						{foreach:items=$first['second'] item=$second}
							{if:$second['visibility'] == 1}
								{set:$tmpSecondId=$second['id'];}
								<a href="{url:/site/pro_list/cat/$tmpSecondId}">{$second['name']}</a> |
							{/if}
						{/foreach}
						{/if}
					</td>
				</tr>
				{/if}
				{/foreach}
			</table>
			<!--商品分类展示-->

			<!--最新商品-->
			<div class="box yellow m_10">
				<div class="title2">
					<h2><img src="{skin:images/front/new_product.gif}" alt="最新商品" width="160" height="36" /></h2>
				</div>
				<div class="cont clearfix">
					<ul class="prolist">
						{query:name=commend_goods as co join=left join goods as go on co.goods_id eq go.id
							where=co.commend_id eq 1 and go.is_del eq 0 AND go.id is not null
							fields=go.list_img,go.sell_price,go.name,go.market_price,go.id
							limit=8
							order=id desc
							group = id
						}
						<li style="overflow:hidden">
							{set:$tmpId=$item['id'];}
							<a href="{url:/site/products/id/$tmpId}"><img src="{webroot:$item[list_img]}" width="175" height="175" alt="{$item['name']}" /></a>
							<p class="pro_title"><a title="{$item['name']}" href="{url:/site/products/id/$tmpId}">{$item['name']}</a></p>
							<p class="brown">惊喜价：<b>￥{$item['sell_price']}</b></p>
							<p class="light_gray">市场价：<s>￥{$item['market_price']}</s></p>
						</li>
						{/query}
					</ul>
				</div>
			</div>
			<!--最新商品-->

			<!--首页推荐商品-->
			{set:$colorArray = array('green','yellow','purple');$colorIndex = 0;}
			{foreach:items=$this->goodsCategory item=$first}
			{if:$first['visibility'] == 1}
			<div class="box {echo:$colorArray[$colorIndex%count($colorArray)]} m_10">
				<div class="title title3">
					{set:$tmpFirstId=$first['id'];}
					<h2><a href="{url:/site/pro_list/cat/$tmpFirstId}"><strong>{$first['name']}</strong></a></h2>
					<a class="more" href="{url:/site/pro_list/cat/$tmpFirstId}">更多商品...</a>
					<ul class="category f_r">
						{set:$secondIdArray = array()}
						{if:isset($first['second'])}
						{foreach:items=$first['second'] item=$second}
							{if:$second['visibility'] == 1}
								{set:$secondIdArray[] = $second['id']}
								{if:$second['more']}
									{foreach:items=$second['more'] item=$v}
										{set:$secondIdArray[] = $v['id']}
									{/foreach}
								{/if}
								{set:$tmpSecondId=$second['id'];}
								<li><a href="{url:/site/pro_list/cat/$tmpSecondId}">{$second['name']}</a><span></span></li>
							{/if}
						{/foreach}
						{/if}
					</ul>
				</div>

				<div class="cont clearfix">
					<ul class="prolist">
						{set:$recomCatId = $first['id']}
						{if:!empty($secondIdArray)}
							{set:$recomCatId .= ','.join(',', $secondIdArray );}
						{/if}
						{query:name=category_extend as ca join = left join goods as go on go.id eq ca.goods_id
						where = ca.category_id in ($recomCatId) and go.is_del eq 0
						limit = 8
						order = go.sort asc,go.id desc
						fields= DISTINCT go.list_img,go.id,go.name,go.sell_price,go.market_price
						}
						<li style="overflow:hidden">
							{set:$tmpId=$item['id'];}
							<a href="{url:/site/products/id/$tmpId}"><img src="{webroot:$item[list_img]}" width="175" height="175" alt="{$item['name']}" title="{$item['name']}" /></a>
							<p class="pro_title"><a title="{$item['name']}" href="{url:/site/products/id/$tmpId}">{$item['name']}</a></p>
							<p class="brown">惊喜价：<b>￥{$item['sell_price']}</b></p>
							<p class="light_gray">市场价：<s>￥{$item['market_price']}</s></p>
						</li>
						{/query}
					</ul>
				</div>

			</div>
			{set:$colorIndex++;}
			{/if}
			{/foreach}

			<!--品牌列表-->
			<div class="brand box m_10">
				<div class="title2"><h2><img src="{skin:images/front/brand.gif}" alt="品牌列表" width="155" height="36" /></h2><a class="more" href="{url:/site/brand}">&lt;<span>全部品牌</span>&gt;</a></div>
				<div class="cont clearfix">
					<ul>
						{query:name=brand fields=id,name,logo order=sort asc limit=6}
						{set:$tmpId=$item['id'];}
						<li><a href="{url:/site/brand_zone/id/$tmpId}"><img src="{webroot:$item[logo]}"  width="110" height="50"/>{$item['name']}</a></li>
						{/query}
					</ul>
				</div>
			</div>
			<!--品牌列表-->

			<!--最新评论-->
			<div class="comment box m_10">
				<div class="title2"><h2><img src="{skin:images/front/comment.gif}" alt="最新评论" width="155" height="36" /></h2></div>
				<div class="cont clearfix">
					{query:name=comment as co
						join=left join goods as go on co.goods_id eq go.id
						order=co.id desc
						limit=6
						where=co.status eq 1 AND go.is_del eq 0 AND go.id is not null
						fields=go.list_img as list_img,go.name as name,co.point,co.contents,co.goods_id
					}
					<dl class="no_bg">
						{set:$tmpGoodsId=$item['goods_id'];}
						<dt><a href="{url:/site/products/id/$tmpGoodsId}"><img src="{webroot:$item[list_img]}" width="65" height="65" /></a></dt>
						<dd><a href="{url:/site/products/id/$tmpGoodsId}">{$item['name']}</a></dd>
						<dd><span class="grade"><i style="width:{echo:$item['point']*14}px"></i></span></dd>
						<dd class="com_c">{$item['contents']}</dd>
					</dl>
					{/query}
				</div>
			</div>
			<!--最新评论-->

		</div>
	</div>
